#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
using namespace std;

class Solution {
public:
    long long minimumSteps(string s)
    {
        long long cnt0 = 0;
        long long cnt1 = 0;
        for (int i = s.size() - 1; i >= 0; i--)
        {
            if (s[i] == '0')
                cnt0++;
            else
                cnt1 += cnt0;
        }
        return cnt1;
    }
};